#include <vector>
#include <iostream>

using namespace std;

class Solution
{
public:
    vector<int> twoSum(vector<int> &nums, int target)
    {
        int n1, n2;
        int tempNum;
        vector<int> temp;
        for (int i = 0; i < nums.size(); i++)
        {
            if (nums[i] > target)
            {
                continue;
            }
            else
            {
                tempNum = target - nums[i];
                for (int j = i; j < nums.size(); j++)
                {
                    if (tempNum == nums[j])
                    {
                        n1 = i;
                        n2 = j;
                        break;
                    }
                }
                break;
            }
        }
        temp.push_back(n1);
        temp.push_back(n2);
        return temp;
    }
};